package fudan.se.lab2.repository;

import fudan.se.lab2.domain.Contribution;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import java.util.Optional;

@Repository
public interface ContributionRepository extends CrudRepository<Contribution, Long> {
    Iterable<Contribution> findByContributor(String contributor);

    Iterable<Contribution> findByMeetingFullName(String meetingFullName);

    Optional<Contribution> findById(Long id);

    Contribution findByFileTitle(String fileTitle);

    Contribution findByContributorAndFileTitle(String contributor, String fileTitle);

    Contribution findByMeetingFullNameAndFileTitle(String meetingFullName, String fileTitle);

    Contribution findByContributorAndMeetingFullNameAndFileTitle(String contributor, String meetFullName, String fileTitle);

    Contribution findByFileAbstract(String fileAbstract);
}
